5.5 Code Converter

Encoders and decoders are fundamental components in the vast landscape of communication and data processing, acting as the crucial bridge between raw information and its transmittable or interpretable form. At their core, these paired mechanisms facilitate the conversion of data from one format to another, often with the aim of ensuring efficient transmission, secure storage, or accurate reconstruction. Encoders transform an input signal or data into a coded format, while decoders reverse this process, converting the coded data back into its original or a usable form. Their applications are ubiquitous, ranging from the intricate digital signals underpinning our internet and mobile communications to the more tangible processes of data compression and error correction, making them indispensable in nearly every modern technological system.

 

Part 5.5.1 Encoder

A combinational circuit that produces n-bit coded combinations of outputs from 2n discrete inputs is called an encoder.

 

Example no. 1

Design an encoder-based combinational circuit that accurately converts a single active octal input (D0 through D7) into its corresponding 3-bit binary output.

 

Solution no. 1

 

Draw the Truth table.

 

Input

Output

D0

D1

D2

D3

D4

D5

D6

D7

x

y

z

1

0

0

0

0

0

0

0

0

0

0

0

1

0

0

0

0

0

0

0

0

1

0

0

1

0

0

0

0

0

0

1

0

0

0

0

1

0

0

0

0

0

1

1

0

0

0

0

1

0

0

0

1

0

0

0

0

0

0

0

1

0

0

1

0

1

0

0

0

0

0

0

1

0

1

1

0

0

0

0

0

0

0

0

1

1

1

1

 

Boolean Expressions:

 

X = D4+D5+D6+D7

Y = D2+D3+D6+D7

Z = D1+D3+D5+D7

 

Logic Circuit:

 

 

 

 

Part 5.5.1.1 Priority Encoder

An encoder circuit that includes a priority function. The operation is such that if two or more inputs are equal to 1 at the same time, the input having the highest priority will take precedence.

 

Example no. 2

 

From the Truth table below, make a combinational logic circuit.

 

 

D0

D1

D2

D3

 

x

y

z

0

0

0

0

 

x

x

0

1

0

0

0

 

0

0

1

x

1

0

0

 

0

1

1

x

x

1

0

 

1

0

1

x

x

x

1

 

1

1

1

Note: x denotes either 1 or 0.

 

Solution no. 2

 

Boolean Expressions:

 

x = D2 + D3

Y = D1D2 + D3

Z = D0 + D1 + D2 + D3

 

The Logic Circuit

Part 5.5.2 Decoder

It is a combinational circuit that converts coded n-bit information to a maximum of 2n unique output lines. The input code generally has fewer bits than the output code.

 

A diagram of a decoder

AI-generated content may be incorrect.

Figure 1. 74x139 Dual 2-to-4 Decoder

 

 

Part 5.5.2.1 Binary Decoders as Minterm Generators

The output of an n-to-

 

Example no. 3

Design a circuit for the logic function F(x,y,z)=Σ(0,2,3,5)

a.) Draw the circuit diagram using individual gates.

b.) Draw the decoder-based circuit.

Solution no. 3

The simplified expression of the function is obtained as 

F=x′z′+x′y+xy′z

Logic circuits:

1.           Using Individual Gates

A diagram of a circuit

AI-generated content may be incorrect.

1.           Using 74x138 3-to-8 Decoder IC

A diagram of a circuit board

AI-generated content may be incorrect.

 

 

 

Part 5.5.2.2 BCD to Decimal Decoder

To change a BCD number to its decimal equivalent, it is done one decimal digit at a time. For each decimal integer, a decoder with four inputs and ten outputs is needed; one decoder is required for each digit in any decimal number to be decoded. For instance, to decode numbers up to 99 requires two decoders, one for the units digit and another for the tens digit. An MSI decoder that can be used to decode 8-4-2-1 code is the 54/7445.

 

A rectangular object with lines and text

AI-generated content may be incorrect.

Figure 2. Block diagram of BCD decoder

 

For each of the ten possible inputs, from 0000 10 1001, only one output line is activated.

 

Part 5.5.2.3 BCD-to-seven segment decoder/driver

The 7447 IC is a BCD-to-seven-segment decoder/driver that has four inputs for the BCD digit. The 4-bit BCD is converted to a seven-segment code with outputs a through g. The outputs of the 7447 are applied to the inputs of the 7730 (or equivalent) seven-segment display.

 

A diagram of a circuit

AI-generated content may be incorrect.

Figure 3. BCD-to-seven-segment decoder (7447) and seven-segment display (7730) (from: Pearson Education, Inc.)